// Copyright 2008 Senary
// See credits.txt for details.

// This file is part of Omega VII.

// Omega VII is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Omega VII is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Omega VII.  If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include "SpaceObject.h"
#include "Constants.h"

// Units up to this distance can be attacked.
const double FIRE_RANGE = 150.0;

class CombatUnit : public SpaceObject
{
protected:
	double _lastHealed; //timestamp of last healing
	double _shield;

public:
	CombatUnit(void);
	virtual ~CombatUnit(void);
	//const
	virtual int maxFirepower() const = 0;
	virtual int maxShield() const = 0;
	//property
	double getShield() const;

	//operations
	virtual void attack(CombatUnit* combatUnit, float timestep, float totalTime);

	// Receive a certain amount of damage
	// param damager: the unit that inflicts the damage.
	virtual void receiveDamage(double damage, CombatUnit* damager, float totalTime);

	virtual void heal(float totalTime);

	virtual void update(float timestep, float totalTime);
};
